﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LeadExpress.Models.ViewPages;

namespace LeadExpress.Repository
{
    public class CategoryManagementRepository : BaseManagementRepository
    {
        LeadExpressEntities entities = new LeadExpressEntities();

        public CategoryManagementModel GetModel(string pageType, string roleName, int id)
        {
            CategoryManagementModel model = new CategoryManagementModel();

            model.HeaderView = GetHeader();
            model.MenuItem = GetMenuItems(roleName, pageType);
            model.ListCategory = new Repository.CategoryRepository().GetAll();
            if (id > 0)
            {
                model.CategoryInfo = new Repository.CategoryRepository().GetSingle(id);
            }

            return model;
        }

        public CategoryManagementModel GetModel(string pageType, string roleName)
        {
            CategoryManagementModel model = new CategoryManagementModel();
            model.ListCategory = new Repository.CategoryRepository().GetAll();

            return model;
        }
    }
}